
const searchFormList = [
  { label: '', width: '200px', value: 'btnOperation', type: 'slot' },
	{ label: '关键词', value: 'query', type: 'input', width: '200px' },
	{ label: '', width: '200px', value: 'btnSearch', type: 'slot' }
];

const tables = [ // 表格数据
  { label: '记录ID', value: 'id', sort:'custom'},
  { label: '明星名称', value: 'star'},
  { label: '管理上限', value: 'lteamer'},
  { label: '超级管理', value: 'ouserid', type: 'slot', width:160},
  { label: '性别', value: 'gender', type: 'slot'},
  { label: '出生日期', value: 'birthday'},
  { label: '描述', value: 'desc', width:200},
  { label: '出道日期', value: 'hisdebut'},
  { label: '经济公司', value: 'agency'},
  { label: '到期时间', value: 'expire'},
  { label: '支付宝', value: 'wallet', type: 'slot', width:120},
  { label: '财务状况', value: 'finance', type: 'slot', width:120},
  { label: '入驻时间', value: 'addtime'}
];

const fieldList = [ // 新增弹出数据
  { label: '明星名称', value: 'star', type: 'input', width: '240px', className:''},
  { label: '别名', value: 'alname', type: 'input', width: '240px', className:''},
  { label: '头像', value: 'avatar', type:'file', width: '240px', accept:'image/jpeg,image/gif,image/png', multiple:false, data:{skey:'file',appdir:'star'}},
  { label: '性别', value: 'gender', type:'select', width: '200px', option: 'sysUserSex', filterable: true, className:''},
  { label: '出生日期', value: 'birthday', type:'date', width: '240px', className:''},
  { label: '出道日期', value: 'hisdebut', type:'date', width: '240px', className:''},
  { label: '管理上限', value: 'lteamer', type:'input', width: '240px', className:''},
  { label: '经济公司', value: 'agency', width: '240px', type:'input', className:''},
  { label: '入驻日期', value: 'addtime', type:'date', width: '240px', className:''},
  { label: '过期日期', value: 'expire', type:'date', width: '240px', className:''},
  { label: '描述', value: 'desc', type:'textarea', width: '500px', className:''},
];

const rules = {
	star: [{ required: true, message: '请输入明星名称', trigger: 'change' }],
  avatar: [{ required: true, message: '请设置明星头像信息', trigger: 'change' }],
  birthday: [{ required: true, message: '请设置出生日期', trigger: 'change' }],
	hisdebut: [{ required: true, message: '请设置出道日期', trigger: 'change' }],
  agency: [{ required: true, message: '请设置明星的经济公司', trigger: 'change' }],
  desc: [{ required: true, message: '请编辑明星的介绍内容', trigger: 'change' }]
};

const fieldUserList = [ // 新增弹出数据
  { label: '明星名称', value: 'star', type: 'input', disabled:true, width: '260px', className:''},
  { label: '超级管理', value: 'ouserid', RawValue: 'user', type: 'inputSearch', width: '260px', option:"appUser", store: "dictSrv/appUser"},
];

const rulesUser = {
  ouserid: [{ required: true, message: '请选择设置超管账号', trigger: 'change' }]
};

const fieldAlipayList = [ // 新增弹出数据
  { label: '明星名称', value: 'star', type: 'input', disabled:true, width: '260px', className:''},
  { label: '收款姓名', value: 'realname', type: 'input', width: '260px', className:''},
  { label: '支付宝账号', value: 'alipay', type: 'input', width: '260px', className:''},
];

const rulesAlipay = {
  realname: [{ required: true, message: '请选择设置收款人姓名', trigger: 'change' }],
  alipay: [{ required: true, message: '请选择设置支付宝账号', trigger: 'change' }]
};

const fieldData = (data)=>{
  var dataset = {};
  for (var idx = 0; idx < fieldList.length; idx++) {
    var ckey  = fieldList[idx].value;
    dataset[ckey] = (data)? data[ckey]:'';
  }
  dataset.id = (data && data.id)? data.id:0;
  return dataset;
}

export default {
  searchFormList,tables,fieldList,fieldData,rules,fieldUserList,rulesUser,fieldAlipayList,rulesAlipay
};